string trackingURL = "http://127.0.0.1/sl-www-integration/track-user.php?";
integer listener = 0;
key http_request_id;

default
{
    state_entry()
    {
        llSetText("Touch to get tracked", <1,1,1>, 1);
    }
    
    touch_start(integer howmany)
    {
        integer i;
        
        for (i = 0; i < howmany; i++)
        {
            http_request_id = llHTTPRequest(trackingURL 
             + "avatarName=" + llEscapeURL(llDetectedName(i))
             + "&avatarKey=" + llEscapeURL(llDetectedKey(i)) 
             + "&avatarPos=" + llEscapeURL((string) llDetectedPos(i))
             + "&avatarRot=" + llEscapeURL((string) llDetectedRot(i))
             + "&avatarVel=" + llEscapeURL((string) llDetectedVel(i))
            , [], "");
        }
    }

    http_response(key request_id, integer status, list metadata, string body)
    {
        if (request_id == http_request_id)
        {
            if (status == 200)
            {
                llSay(0, body);
            }
            else // HTTP Request failed
                llSay(0, "Error " + (string)status + ": " + body);
        }
    }
}